<?php

/**
 * 用户登录、登出控制器
 * Class Read
 */
class Base extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->model('Admin_model');
		$this->load->helper('url');
	}

	public function login()
	{
		if ($_POST) {
			$username = $this->input->post('username');
			$password = $this->input->post('password');
			// 验证用户
			$user = $this->Admin_model->login($username, $password);
			if ($user['ret'] == '1') {
				redirect(base_url() . 'bm/index/main');
			}
		} else {
			$this->load->view('bm/base/login');
		}
	}

	public function logout()
	{

	}
}
